<template>
  <div class="app-container">
    <Ht-search-form
      v-show="showSearch"
      :advOptions="[]"
      :dictMap="dictMapAsync"
      :formOptions="formOptions"
      :outputQueryParams="queryParams"
      :queryParams="queryParams"
      :defaultEventKey="defaultEventKey"
      :labelWidth="100"
    ></Ht-search-form>

    <!--    <div class="page-label-block">-->
    <!--      <span class="color-block">|</span>-->
    <!--      <span class="page-label-name">-->
    <!--      租户管理-->
    <!--      </span>-->
    <!--    </div>-->

    <ht-table
      ref="dataTable"
      :dictMap="dictMap"
      :multi-select="false"
      :opButtonList="opButtonList"
      :queryParams="queryParams"
      :reqConfig="regConfig"
      :showSerialNumber="false"
      :tableBindColumns="tableBindColumns"
      :defaultEventKey="defaultEventKey"
    >
      <template v-slot:operate>
        <el-table-column align="left" fixed="right" label="操作" width="50">
          <template slot-scope="scope">
            <ht-button-group
              :buttonList="[
                {
                  label: '审核',
                  doFunc: () => {
                    handleAction('detail', scope.row);
                  },
                },
              ]"
            />
          </template>
        </el-table-column>
      </template>
    </ht-table>

    <!-- 添加或修改弹出框 -->
    <el-dialog
      :close-on-click-modal="false"
      :title="title"
      center
      :visible.sync="open"
      v-if="open"
      append-to-body
      width="1024px"
    >
      <!--318-->
      <el-form
        ref="detailForm"
        :disabled="true"
        v-if="
          this.detailForm.pkgNo === 'ccms.318.001.01' &&
          (this.detailForm.sysCode === 'HVPS' || this.detailForm.backType === 'RP00')
        "
        :model="detailForm"
        label-width="140px"
      >
        <el-card class="form-card txnInfo-card">
          <div slot="header" class="label-header-msg">
            <span>交易基础信息</span>
          </div>
          <el-row type="flex">
            <el-col :span="24">
              <el-form-item label="交易流水号" prop="id">
                <el-input v-model="detailForm.id" />
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="工作日期" prop="workdate">
                <el-date-picker v-model="detailForm.workdate" style="width: 100%" type="date" value-format="yyyyMMdd" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="CPG日期" prop="cpgdate">
                <el-date-picker v-model="detailForm.cpgdate" style="width: 100%" type="date" value-format="yyyyMMdd" />
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="发起行行号" prop="inDirectSender">
                <el-input v-model="detailForm.inDirectSender" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="发起行行名" prop="inDirectSenderBankName">
                <el-input v-model="detailForm.inDirectSenderBankName" />
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="接收行行号" prop="inDirectRecver">
                <el-input v-model="detailForm.inDirectRecver" />
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="接收行行名" prop="inDirectRecverBankName">
                <el-input v-model="detailForm.inDirectRecverBankName" />
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="系统编号" prop="sysCode">
                <el-select v-model="detailForm.sysCode" placeholder="系统编号" style="width: 100%">
                  <el-option
                    v-for="dict in dictMap.SYS_CODE_310_312"
                    :key="dict.value"
                    :label="`${dict.value}-${dict.text}`"
                    :value="dict.value"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="退回类型" prop="backType">
                <el-select v-model="detailForm.backType" placeholder="退回类型" style="width: 100%">
                  <el-option
                    v-for="dict in dictMap.RETURNTYPECODE"
                    :key="dict.value"
                    :label="`${dict.value}-${dict.text}`"
                    :value="dict.value"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="报文类型" prop="pkgNo">
                <el-select
                  v-model="detailForm.pkgNo + '-' + detailForm.pkgNoDesc"
                  placeholder="报文类型"
                  style="width: 100%"
                ></el-select>
              </el-form-item>
            </el-col>
          </el-row>
        </el-card>

        <el-card class="form-card txnInfo-card">
          <div slot="header" class="label-header-msg">
            <span>原业务信息</span>
          </div>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="原交易流水号" prop="oriId">
                <el-input v-model="detailForm.oriId" />
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="原报文标识号" prop="oriPkgId">
                <el-input v-model="detailForm.oriPkgId" />
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="原报文类型" prop="oriMsgType">
                <el-select
                  v-model="detailForm.oriMsgType + '-' + detailForm.oriMsgTypeDesc"
                  placeholder="报文类型"
                  style="width: 100%"
                ></el-select>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="原发起行行行号" prop="oriSenderTrue">
                <el-input v-model="detailForm.oriSenderTrue" />
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="原发起行行名" prop="oriSenderBankNameTrue">
                <el-input v-model="detailForm.oriSenderBankNameTrue" />
              </el-form-item>
            </el-col>
          </el-row>
        </el-card>

        <el-card class="form-card txnInfo-card">
          <div slot="header" class="label-header-msg">
            <span>原业务信息</span>
          </div>
          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="录入操作员" prop="mdTlrno">
                <el-input v-model="detailForm.mdTlrno" />
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="录入时间" prop="mdTime">
                <el-date-picker
                  v-model="detailForm.mdTime"
                  style="width: 100%"
                  type="datetime"
                  value-format="yyyyMMddHHmmss"
                />
              </el-form-item>
            </el-col>
          </el-row>
        </el-card>
      </el-form>

      <!--319-->
      <el-form
        ref="detailForm"
        :disabled="true"
        v-if="
          this.detailForm.pkgNo !== 'ccms.318.001.01' &&
          (this.detailForm.sysCode === 'HVPS' || this.detailForm.backType === 'RP00')
        "
        :model="detailForm"
        label-width="140px"
      >
        <el-card class="form-card txnInfo-card">
          <div slot="header" class="label-header-msg">
            <span>交易基础信息</span>
          </div>
          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="交易流水号" prop="id">
                <el-input v-model="detailForm.id" />
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="工作日期" prop="workdate">
                <el-date-picker v-model="detailForm.workdate" style="width: 100%" type="date" value-format="yyyyMMdd" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="CPG日期" prop="cpgdate">
                <el-date-picker v-model="detailForm.cpgdate" style="width: 100%" type="date" value-format="yyyyMMdd" />
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="发起行行号" prop="inDirectSender">
                <el-input v-model="detailForm.inDirectSender" />
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="发起行行名" prop="inDirectSenderBankName">
                <el-input v-model="detailForm.inDirectSenderBankName" />
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="接收行行号" prop="inDirectRecver">
                <el-input v-model="detailForm.inDirectRecver" />
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="接收行行名" prop="inDirectRecverBankName">
                <el-input v-model="detailForm.inDirectRecverBankName" />
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="系统编号" prop="sysCode">
                <el-select v-model="detailForm.sysCode" placeholder="系统编号" style="width: 100%">
                  <el-option
                    v-for="dict in dictMap.SYS_CODE_310_312"
                    :key="dict.value"
                    :label="`${dict.value}-${dict.text}`"
                    :value="dict.value"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="退回类型" prop="backType">
                <el-select v-model="detailForm.backType" placeholder="退回类型" style="width: 100%">
                  <el-option
                    v-for="dict in dictMap.RETURNTYPECODE"
                    :key="dict.value"
                    :label="`${dict.value}-${dict.text}`"
                    :value="dict.value"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="报文类型" prop="pkgNo">
                <el-select
                  v-model="detailForm.pkgNo + '-' + detailForm.pkgNoDesc"
                  placeholder="报文类型"
                  style="width: 100%"
                ></el-select>
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="退回应答结果" prop="sysCode">
                <el-select style="width: 100%" v-model="detailForm.backResult" placeholder="退回应答结果">
                  <el-option
                    v-for="dict in dictMap.RET_ANSWER_RP00"
                    :key="dict.value"
                    :label="`${dict.value}-${dict.text}`"
                    :value="dict.value"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="24">
              <el-form-item label="附言" prop="remarks">
                <el-input v-model="detailForm.remarks" type="textarea" />
              </el-form-item>
            </el-col>
          </el-row>
        </el-card>

        <el-card class="form-card txnInfo-card">
          <div slot="header" class="label-header-msg">
            <span>原退回信息</span>
          </div>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="原交易流水号" prop="oriId">
                <el-input v-model="detailForm.oriId" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="原报文标识号" prop="oriPkgId">
                <el-input v-model="detailForm.oriPkgId" />
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="原报文类型" prop="oriMsgType">
                <el-select
                  v-model="detailForm.oriMsgType + '-' + detailForm.oriMsgTypeDesc"
                  placeholder="报文类型"
                  style="width: 100%"
                ></el-select>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="原发起行行行号" prop="oriSenderTrue">
                <el-input v-model="detailForm.oriSenderTrue" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="原发起行行名" prop="oriSenderBankNameTrue">
                <el-input v-model="detailForm.oriSenderBankNameTrue" />
              </el-form-item>
            </el-col>
          </el-row>
        </el-card>

        <el-card class="form-card txnInfo-card">
          <div slot="header" class="label-header-msg">
            <span>原交易信息</span>
          </div>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="原发起行行行号" prop="txnOriSender">
                <el-input v-model="detailForm.txnOriSender" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="原发起行行名" prop="txnOriSenderName">
                <el-input v-model="detailForm.txnOriSenderName" />
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="原交易流水号" prop="oriTxnId">
                <el-input v-model="detailForm.oriTxnId" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="原报文标识号/批次号" prop="txnOriPkgId">
                <el-input v-model="detailForm.txnOriPkgId" />
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="原报文种类" prop="txnOriMsgType">
                <el-select style="width: 100%" v-model="detailForm.txnOriMsgType" placeholder="原报文种类">
                  <el-option
                    v-for="dict in dictMap.PKG_TYPE"
                    :key="dict.value"
                    :label="`${dict.value}-${dict.text}`"
                    :value="dict.value"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
        </el-card>

        <el-card class="form-card txnInfo-card">
          <div slot="header" class="label-header-msg">
            <span>录入信息</span>
          </div>
          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="录入操作员" prop="mdTlrno">
                <el-input v-model="detailForm.mdTlrno" />
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="录入时间" prop="mdTime">
                <el-date-picker
                  v-model="detailForm.mdTime"
                  style="width: 100%"
                  type="datetime"
                  value-format="yyyyMMddHHmmss"
                />
              </el-form-item>
            </el-col>
          </el-row>
        </el-card>
      </el-form>

      <!--318 beps-->
      <el-form
        ref="detailForm"
        :disabled="true"
        v-if="
          this.detailForm.pkgNo === 'ccms.318.001.01' &&
          this.detailForm.sysCode === 'BEPS' &&
          this.detailForm.backType === 'RP01'
        "
        :model="detailForm"
        label-width="140px"
      >
        <el-card class="form-card txnInfo-card">
          <div slot="header" class="label-header-msg">
            <span>交易基础信息</span>
          </div>
          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="交易流水号" prop="id">
                <el-input v-model="detailForm.id" />
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="工作日期" prop="workdate">
                <el-date-picker v-model="detailForm.workdate" style="width: 100%" type="date" value-format="yyyyMMdd" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="CPG日期" prop="cpgdate">
                <el-date-picker v-model="detailForm.cpgdate" style="width: 100%" type="date" value-format="yyyyMMdd" />
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="发起行行号" prop="inDirectSender">
                <el-input v-model="detailForm.inDirectSender" />
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="发起行行名" prop="inDirectSenderBankName">
                <el-input v-model="detailForm.inDirectSenderBankName" />
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="接收行行号" prop="inDirectRecver">
                <el-input v-model="detailForm.inDirectRecver" />
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="接收行行名" prop="inDirectRecverBankName">
                <el-input v-model="detailForm.inDirectRecverBankName" />
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="系统编号" prop="sysCode">
                <el-select v-model="detailForm.sysCode" placeholder="系统编号" style="width: 100%">
                  <el-option
                    v-for="dict in dictMap.SYS_CODE_310_312"
                    :key="dict.value"
                    :label="`${dict.value}-${dict.text}`"
                    :value="dict.value"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="退回类型" prop="backType">
                <el-select v-model="detailForm.backType" placeholder="退回类型" style="width: 100%">
                  <el-option
                    v-for="dict in dictMap.RETURNTYPECODE"
                    :key="dict.value"
                    :label="`${dict.value}-${dict.text}`"
                    :value="dict.value"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="报文类型" prop="pkgNo">
                <el-select
                  v-model="detailForm.pkgNo + '-' + detailForm.pkgNoDesc"
                  placeholder="报文类型"
                  style="width: 100%"
                ></el-select>
              </el-form-item>
            </el-col>
          </el-row>
        </el-card>

        <ht-table
          ref="dataTable"
          :multi-select="false"
          :showSerialNumber="false"
          :dictMap="dictMap"
          :queryParams="queryParamsBepsQuery"
          :tableBindColumns="beps318tableBindColumns"
          :reqConfig="beps318regConfig"
          :showRightToolbar="false"
        />

        <el-card class="form-card txnInfo-card">
          <div slot="header" class="label-header-msg">
            <span>录入信息</span>
          </div>
          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="录入操作员" prop="mdTlrno">
                <el-input v-model="detailForm.mdTlrno" />
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="录入时间" prop="mdTime">
                <el-date-picker
                  v-model="detailForm.mdTime"
                  style="width: 100%"
                  type="datetime"
                  value-format="yyyyMMddHHmmss"
                />
              </el-form-item>
            </el-col>
          </el-row>
        </el-card>
      </el-form>

      <!--319 beps-->
      <el-form
        ref="detailForm"
        :disabled="true"
        v-if="
          this.detailForm.pkgNo !== 'ccms.318.001.01' &&
          this.detailForm.sysCode === 'BEPS' &&
          this.detailForm.backType === 'RP01'
        "
        :model="detailForm"
        label-width="140px"
      >
        <el-card class="form-card txnInfo-card">
          <div slot="header" class="label-header-msg">
            <span>交易基础信息</span>
          </div>
          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="交易流水号" prop="id">
                <el-input v-model="detailForm.id" />
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="工作日期" prop="workdate">
                <el-date-picker v-model="detailForm.workdate" style="width: 100%" type="date" value-format="yyyyMMdd" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="CPG日期" prop="cpgdate">
                <el-date-picker v-model="detailForm.cpgdate" style="width: 100%" type="date" value-format="yyyyMMdd" />
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="系统编号" prop="sysCode">
                <el-select v-model="detailForm.sysCode" placeholder="系统编号" style="width: 100%">
                  <el-option
                    v-for="dict in dictMap.SYS_CODE_310_312"
                    :key="dict.value"
                    :label="`${dict.value}-${dict.text}`"
                    :value="dict.value"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="退回类型" prop="backType">
                <el-select v-model="detailForm.backType" placeholder="退回类型" style="width: 100%">
                  <el-option
                    v-for="dict in dictMap.RETURNTYPECODE"
                    :key="dict.value"
                    :label="`${dict.value}-${dict.text}`"
                    :value="dict.value"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="报文类型" prop="pkgNo">
                <el-select
                  v-model="detailForm.pkgNo + '-' + detailForm.pkgNoDesc"
                  placeholder="报文类型"
                  style="width: 100%"
                ></el-select>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row type="flex">
            <el-col :span="24">
              <el-form-item label="附言" prop="remarks">
                <el-input type="textarea" v-model="detailForm.remarks" />
              </el-form-item>
            </el-col>
          </el-row>
        </el-card>

        <ht-table
          ref="dataTable"
          :multi-select="false"
          :showSerialNumber="false"
          :dictMap="dictMap"
          :queryParams="queryParamsBepsQuery"
          :tableBindColumns="beps319tableBindColumns"
          :reqConfig="beps319regConfig"
          :showRightToolbar="false"
        />

        <el-card class="form-card txnInfo-card">
          <div slot="header" class="label-header-msg">
            <span>录入信息</span>
          </div>
          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="录入操作员" prop="mdTlrno">
                <el-input v-model="detailForm.mdTlrno" />
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="录入时间" prop="mdTime">
                <el-date-picker
                  v-model="detailForm.mdTime"
                  style="width: 100%"
                  type="datetime"
                  value-format="yyyyMMddHHmmss"
                />
              </el-form-item>
            </el-col>
          </el-row>
        </el-card>
      </el-form>

      <div slot="footer" align="center" class="dialog-footer">
        <el-button type="primary" @click="approve" v-loading.fullscreen.lock="loading">审 核</el-button>
        <el-button type="primary" @click="reject" v-loading.fullscreen.lock="loading">拒 绝</el-button>
        <el-button type="primary" @click="cancel">关 闭</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import {
  apibeps318UrlConfigApprove,
  apibeps319UrlConfigApprove,
  apiUrlConfigApprove,
  ccmsBusinessReturnApproveDeatil,
  ccmsBusinessReturnResponseApproveApprvoe,
  ccmsBusinessReturnResponseApproveReject,
} from "@/api/cnaps/ccms/318";
import { listPageMixin } from "@/libs/listPageMixin";
import { amountThousandsFormatter } from "@/utils/table_col_formatter";
export default {
  name: "CcmsBusinessReturnApprove",
  mixins: [listPageMixin],
  components: {},
  data() {
    return {
      // 查询参数
      defaultEventKey: "defaultEventKey",
      loading: false,
      queryParams: {
        id: "",
        oriId: "",
        cpgdate1: "",
        cpgdate2: "",
        workdate1: "",
        workdate2: "",
      },
      queryParamsBepsQuery: {
        id: undefined,
      },
      // 搜索
      formOptions: [],
      //
      searchFormDictList: ["SYS_CODE_310_312", "RETURNTYPECODE", "RET_ANSWER_RP00", "PKG_TYPE"],
      // 列信息
      regConfig: apiUrlConfigApprove,

      beps318regConfig: apibeps318UrlConfigApprove,

      beps319regConfig: apibeps319UrlConfigApprove,

      tableBindColumns: [
        {
          prop: "id",
          align: "center",
          label: "交易流水号",
          width: "180",
        },
        {
          prop: "oriId",
          align: "center",
          label: "原交易流水号",
          width: "180",
        },
        {
          prop: "workdate",
          align: "center",
          label: "工作日期",
          type: "date",
        },
        {
          prop: "cpgdate",
          align: "center",
          label: "CPG日期",
          type: "date",
        },
        {
          prop: "sysCode",
          align: "center",
          label: "系统编号",
          dictCode: "SYS_CODE_310_312",
          width: "180",
        },
        {
          prop: "pkgNo",
          align: "center",
          label: "报文类型",
          formatter(row, text, index) {
            return row["pkgNo"] + "-" + row["pkgNoDesc"];
          },
          width: "240",
        },
        {
          prop: "oriMsgType",
          align: "center",
          label: "原报文类型",
          formatter(row, text, index) {
            return row["oriMsgType"] + "-" + row["oriMsgTypeDesc"];
          },
          width: "240",
        },
        {
          prop: "backType",
          align: "center",
          label: "退回类型",
          dictCode: "RETURNTYPECODE",
          width: "240",
        },
        {
          prop: "mdTlrno",
          align: "center",
          label: "录入操作员",
          sortable: false,
        },
        {
          prop: "mdTime",
          align: "center",
          label: "录入时间",
          type: "date",
          width: "200",
        },
      ],
      dictMapAsync: {},
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 表单参数
      detailForm: {
        pkgNo: undefined,
        pkgNoDesc: undefined,
      },
      totalRecord: 0,
      totalPage: 0,
      needCount: 0,
      beps318tableBindColumns: [
        { prop: "id", label: "交易流水号", width: 180 },
        { prop: "txnOriDtlNo", label: "原明细标识号", width: 180 },
        { prop: "coreId", label: "原交易流水号", width: 180 },
        { prop: "txnOriDirectSender", label: "原交易发起直接参与机构", width: 180 },
        { prop: "txnOriInDirectSender", label: "原交易发起间接参与机构", width: 180 },
        { prop: "txnOriDirectRecver", label: "原交易接收直接参与机构号", width: 180 },
        { prop: "txnOriInDirectRecver", label: "原交易接收间接参与机构号", width: 180 },
        {
          prop: "oriBizCode",
          label: "原业务类型编码",
          formatter(row, text, index) {
            return (
              (row["oriBizCode"] === null || row["oriBizCode"] === undefined ? "" : row["oriBizCode"]) +
              "-" +
              (row["bizTypeCodeDesc"] === null || row["bizTypeCodeDesc"] === undefined ? "" : row["bizTypeCodeDesc"])
            );
          },
          width: 180,
        },
      ],

      beps319tableBindColumns: [
        { prop: "id", label: "交易流水号", width: 180 },
        { prop: "txnOriDtlNo", label: "原明细标识号", width: 180 },
        { prop: "backAmtcurcd", label: "退回金额货币", width: 180 },
        {
          prop: "backAmt",
          label: "退回金额",
          type: "price",
        },
        { prop: "txnOriDirectSender", label: "原交易发起直接参与机构", width: 180 },
        { prop: "txnOriDirectRecver", label: "原交易接收直接参与机构号", width: 180 },
        { prop: "oriBizCode", label: "原业务类型编码", width: 180 },
      ],
      rules: {},
    };
  },
  mounted() {
    const formOptions = [
      // 普通搜索

      {
        type: "dates",
        nameObj: {
          startTimeName: "cpgdate1",
          endTimeName: "cpgdate2",
        },
        defaultAttr: {
          size: "small",
          label: "CPG日期",
          placeholder: ["请输入CPG开始日期", "请输入CPG结束日期"],
          format: "yyyy-MM-dd",
          valueFormat: "yyyyMMdd",
        },
      },

      {
        type: "dates",
        nameObj: {
          startTimeName: "workdate1",
          endTimeName: "workdate2",
        },
        defaultAttr: {
          size: "small",
          label: "工作日期",
          placeholder: ["请输入工作开始日期", "请输入工作结束日期"],
          format: "yyyy-MM-dd",
          valueFormat: "yyyyMMdd",
        },
      },

      {
        type: "input",
        prop: "id",
        defaultAttr: {
          size: "small",
          label: "交易流水号",
          placeholder: "请输入交易流水号",
        },
      },
      {
        type: "input",
        prop: "oriId",
        defaultAttr: {
          size: "small",
          label: "原交易流水号",
          placeholder: "请输入原交易流水号",
        },
      },
    ];
    this.formOptions = formOptions;
    this.dictMapAsync = this.getDictMap();
  },
  methods: {
    /***
     * 按钮操作汇总
     */
    /***
     * 按钮操作汇总
     */
    handleAction(type, row = {}) {
      switch (type) {
        case "detail":
          this.handleDetail(row);
          break;
      }
    },

    // 关闭按钮
    cancel() {
      this.open = false;
    },

    /** 详情按钮操作 */
    handleDetail(row) {
      this.title = "业务退回审核明细";
      ccmsBusinessReturnApproveDeatil(row).then((response) => {
        this.detailForm = response.result;
        this.queryParamsBepsQuery.id = response.result.id;
        this.open = true;
      });
    },
    //点击审核按钮
    approve: function () {
      this.loading = true;
      ccmsBusinessReturnResponseApproveApprvoe(this.detailForm)
        .then((response) => {
          this.msgSuccess("审核成功");
          this.open = false;
          this.loading = false;
          this.$nextTick(() => {
            this.$refs.dataTable.doQuery(true);
          });
        })
        .catch((err) => {
          this.loading = false;
        });
    },

    //点击拒绝按钮
    reject() {
      this.loading = true;
      ccmsBusinessReturnResponseApproveReject(this.detailForm)
        .then((response) => {
          this.msgSuccess("拒绝成功");
          this.open = false;
          this.loading = false;
          this.$nextTick(() => {
            this.$refs.dataTable.doQuery(true);
          });
        })
        .catch((err) => {
          this.loading = false;
        });
    },
  },
};
</script>
<style>
.label-header-msg {
  font-weight: bold;
}

.form-card {
  margin-bottom: 10px;
}
</style>
